#ifndef _WX_FONTUTIL_H_
#define _WX_FONTUTIL_H_

#include "wx/font.h"

class wxArrayString;
struct wxNativeEncodingInfo;

#if defined(_WX_X_FONTLIKE)

enum wxXLFDField {
  wxXLFD_FOUNDRY,     // adobe
  wxXLFD_FAMILY,      // courier, times, ...
  wxXLFD_WEIGHT,      // black, bold, demibold, medium, regular, light
  wxXLFD_SLANT,       // r/i/o (roman/italique/oblique)
  wxXLFD_SETWIDTH,    // condensed, expanded, ...
  wxXLFD_ADDSTYLE,    // whatever - usually nothing
  wxXLFD_PIXELSIZE,   // size in pixels
  wxXLFD_POINTSIZE,   // size in points
  wxXLFD_RESX,        // 72, 75, 100, ...
  wxXLFD_RESY,
  wxXLFD_SPACING,     // m/p/c (monospaced/proportional/character cell)
  wxXLFD_AVGWIDTH,    // average width in 1/10 pixels
  wxXLFD_REGISTRY,    // iso8859, rawin, koi8, ...
  wxXLFD_ENCODING,    // 1, r, r, ...
  wxXLFD_MAX
};

#endif // _WX_X_FONTLIKE

class wxNativeFontInfo {
  public:
    PangoFontDescription *description;
    wxNativeFontInfo() { Init(); }
  private:
    void Init( const wxNativeFontInfo& info );
    void Free();

  public:
    wxNativeFontInfo( const wxNativeFontInfo& info ) { Init( info ); }
    ~wxNativeFontInfo() { Free(); }

    wxNativeFontInfo& operator=( const wxNativeFontInfo& info ) {
      Free();
      Init( info );
      return *this;
    }
    void Init();

    void InitFromFont( const wxFont& font ) {
      // translate all font parameters
      SetStyle( ( wxFontStyle )font.GetStyle() );
      SetWeight( ( wxFontWeight )font.GetWeight() );
      SetUnderlined( font.GetUnderlined() );
      SetPointSize( font.GetPointSize() );
      // set the family/facename
      SetFamily( ( wxFontFamily )font.GetFamily() );
      const wxString& facename = font.GetFaceName();
      if( !facename.empty() ) {
        SetFaceName( facename );
      }
      SetEncoding( font.GetEncoding() );
    }
    int GetPointSize() const;
    wxSize GetPixelSize() const;
    wxFontStyle GetStyle() const;
    wxFontWeight GetWeight() const;
    bool GetUnderlined() const;
    wxString GetFaceName() const;
    wxFontFamily GetFamily() const;
    wxFontEncoding GetEncoding() const;

    void SetPointSize( int pointsize );
    void SetPixelSize( const wxSize& pixelSize );
    void SetStyle( wxFontStyle style );
    void SetWeight( wxFontWeight weight );
    void SetUnderlined( bool underlined );
    bool SetFaceName( const wxString& facename );
    void SetFamily( wxFontFamily family );
    void SetEncoding( wxFontEncoding encoding );
    void SetFaceName( const wxArrayString &facenames );
    bool FromString( const wxString& s );
    wxString ToString() const;
    bool FromUserString( const wxString& s );
    wxString ToUserString() const;
};

extern bool wxGetNativeFontEncoding( wxFontEncoding encoding,wxNativeEncodingInfo *info );
extern bool wxTestFontEncoding( const wxNativeEncodingInfo& info );

#ifdef _WX_X_FONTLIKE
#include "wx/unix/fontutil.h"
#endif

#endif
